<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<t:baselayout>
    <jsp:attribute name="pageTitle">Quizz du cours ${questions[0].course.name}</jsp:attribute>
    <jsp:body>
        <h2>Quizz du cours ${questions[0].course.name}</h2>
        <div class="alert alert-info alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            Un petit oubli ? Pas de problème ! Vous pouvez retourner au <a class='alert-link' href="<c:url value='/course/${questions[0].course.id}'/>">cours</a> quand vous voulez.
        </div>
        <form  role='form' action="<c:url value='/quizz/${questions[0].course.id}'/>" method='post'>
            <c:forEach var="question" items="${questions}">
                <div class="form-group">
                    <label class="control-label">${question.title}</label>
                    <c:forEach var="answer" items="${question.answers}">
                        <div class="radio">
                            <label>
                                <input type="radio" name="question${question.id}" value="${answer.id}" title=" ${answer.title}">
                                ${answer.title}
                            </label>
                        </div>
                    </c:forEach>
                </div>
            </c:forEach>
            <div class="form-group">
                <button type='submit' class="btn btn-primary">Valider</button>
                <button type='reset' class="btn btn-default">Réinitialiser</button>
            </div>
        </form>
    </jsp:body>
</t:baselayout>